/**
 * Custo renderer for the rows of the Item table
 * 
 * @author remo.lemma@lu.unisi.ch
 */

package ch.unisi.inf.projects.java.uom.gui.table.item;

import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class UOMItemTableCellRenderer extends DefaultTableCellRenderer
{
	/** We are not going to serialize this class atm */
    private static final long serialVersionUID = -1L;
	    
	public UOMItemTableCellRenderer ()
	{
		super();
	}
    
	public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) 
	{
    	setToolTipText("<html><b>" + table.getColumnName(column) + "</b>: " + value + "</html>");
    	super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    	return this;
    }
}
